package com.my.lab;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.os.Bundle;
import android.view.Display;
import android.view.MotionEvent;
import android.view.Window;

public class RadiusActivity extends Activity {
	
	private int width = 0;
	private int heigh = 0;
	private Canvas canvas = null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.radius);
		Display display = getWindowManager().getDefaultDisplay();
		width = display.getWidth();
		heigh = display.getHeight();
	}

	private void drawBitmap(float x, float y) {
		Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.new_sms_button_bg_a);
		canvas = new Canvas();
		canvas.drawBitmap(bitmap, x , y, null);		
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		float x = event.getX();
		float y = event.getY();
		switch (event.getAction()) {
		case MotionEvent.ACTION_DOWN:
			drawBitmap(x, y);
			return true;

		case MotionEvent.ACTION_UP:
			break;
		}
		return super.onTouchEvent(event);
	}
}
